package com.vlin.device.value.converter.condition;

import java.util.ArrayList;
import java.util.List;

import com.vlin.device.value.converter.condition.utils.TuyaUtils;

public class TuyaEnum {

	private final List<String> list = new ArrayList<>();
	private final List<Integer> listInt = new ArrayList<Integer>();

	public TuyaEnum(String...values ) {
		if(values != null) {
			for(String value : values) {
				if(value != null && !value.isEmpty()) {
					list.add(value);
					listInt.add(TuyaUtils.stringHash(value));
				}
			}
		}
	}

	public boolean support(String enumm) {
		int v = TuyaUtils.stringHash(enumm);
		for(Integer i : listInt) {
			if(i.equals(v)) {
				return true;
			}
		}
		return false;
	}
	
	public List<String> getList(){
		return this.list;
	}
	
	public List<Integer> getHashList(){
		return this.listInt;
	}
	
}
